const tools = {
  extractUrl: (url) => {
    const urlPatterns = [
      /(https?:\/\/[^\s]+)/, // 基本URL
      /(https?:\/\/[^\s]+)\s*复制此链接/, // 抖音格式
      /(https?:\/\/[^\s]+)/, // 通用格式
    ];

    for (const pattern of urlPatterns) {
      const match = url.match(pattern);
      if (match && match[1]) {
        return match[1].trim();
      }
    }

    return null;
  },
  downloadVideoFromUrl: (shareUrl) => {

  }

}

module.exports = tools;